 /* 
 * File:   cObjectMap.h
 * Author: josep
 *
 * Created on 30 / desembre / 2010, 18:39
 */

#ifndef COBJECTMAP_H
#define	COBJECTMAP_H

#include "cTexture.h"
#include "cData.h"
#include "cItem.h"
#include "cTexturizedObject.h"

class cObjectMap: public cTexturizedObject{
public:
    cObjectMap();
    cObjectMap(const cObjectMap& orig);
    virtual ~cObjectMap();
    void InitFromIniFile(const char* pName, cData *Data);
    bool LoadMap(int level);
    void Draw();
    int GetMapHeight();
    int GetMapWidth();
    int GetTileSize();
    list<cItem*> *GetItems();
    
private:
    string fileNameConfig;
    string extensionFilenameConfig;
    int tileSize;
    int MapWidth;
    int MapHeight;
    map<int, cItem* > cfgItems;
    list<cItem* > Items;


    void Init();
    void setImageFileName(string iniValue, string &file);
    void setDataFilename(string iniValue);
    void setDataExtension(string iniValue);
    void setDimension(string iniValueLine);
    void setTileSize(string iniValueLine);
    void setBlockSize(string iniValueLine);
    void addItem(string iniValueLine, int tileSize);
};

#endif	/* COBJECTMAP_H */

